<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>FRESCO COFFEE ADMIN PANEL</title>
        <link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/screen_admin.css" type="text/css" media="screen" title="default" />
        <link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/message.css" type="text/css" /> 
        <link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/jquery-ui-1.8.20.custom.css" type="text/css" /> 
        <link rel="SHORTCUT ICON" href="<?php echo Yii::app()->theme->baseUrl; ?>/images/shared/fresco_icon.ico" />
        
        <!--[if IE]>
        <link rel="stylesheet" media="all" type="text/css" href="css/pro_dropline_ie.css" />
        <![endif]-->
        <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery/jquery-1.4.1.min.js" type="text/javascript"></script>
<!--        <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery/jquery.cookies.js" type="text/javascript"></script>-->
        <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery/jquery.bind.js" type="text/javascript"></script> 
<!--        <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery/ui.core.js" type="text/javascript"></script>-->
        
        <!--[if !IE 7]>

        <!--  styled select box script version 1 -->
        <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery/jquery.selectbox-0.5.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('.styledselect').selectbox({ inputClass: "selectbox_styled" });
            });
        </script>


        <!--[endif]>

        <!--  styled select box script version 2 --> 
        <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery/jquery.selectbox-0.5_style_2.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('.styledselect_form_1').selectbox({ inputClass: "styledselect_form_1" });
                $('.styledselect_form_2').selectbox({ inputClass: "styledselect_form_2" });
            });
        </script>
        
        <!--  styled select box script version 3 --> 
        <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery/jquery.selectbox-0.5_style_2.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('.styledselect_pages').selectbox({ inputClass: "styledselect_pages" });
            });
        </script>

        <!--  styled file upload script --> 
        <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery/jquery.filestyle.js" type="text/javascript"></script>
        <script type="text/javascript" charset="utf-8">
            $(function() {
                $("input.file_1").filestyle({ 
                    image: "<?php echo Yii::app()->theme->baseUrl; ?>/images/forms/choose-file.gif",
                    imageheight : 21,
                    imagewidth : 78,
                    width : 310
                });
            });
        </script>
        
        <!-- Custom jquery scripts -->
        <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery/custom_jquery.js" type="text/javascript"></script>

        <!-- Tooltips -->
        <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery/jquery.tooltip.js" type="text/javascript"></script>
        <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery/jquery.dimensions.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function() {
                $('a.info-tooltip ').tooltip({
                    track: true,
                    delay: 0,
                    fixPNG: true, 
                    showURL: false,
                    showBody: " - ",
                    top: -35,
                    left: 5
                });
            });
        </script>        
    </head>
    <body> 
        <?php 
            Yii::import('application.modules.menu.utililies.menuService');
            $controller = (Yii::app()->controller->id);             
        ?>
        <!-- Start: page-top-outer -->
        <div id="page-top-outer">    

            <!-- Start: page-top -->
            <div id="page-top">

                <!-- start logo -->
                <div id="logo">
                    <a href="<?php echo Yii::app()->createUrl("menu/drink/admin"); ?>"><img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/shared/fresco_logo.png" width="50%" alt="" /></a>
                </div>
                <!-- end logo -->

                <!--  start top-search -->
<!--                <div id="top-search">
                    <table border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td><input type="text" value="Search" onblur="if (this.value=='') { this.value='Search'; }" onfocus="if (this.value=='Search') { this.value=''; }" class="top-search-inp" /></td>
                            <td>
                                <select  class="styledselect">
                                    <option value=""> All</option>
                                    <option value=""> Products</option>
                                    <option value=""> Categories</option>
                                    <option value="">Clients</option>
                                    <option value="">News</option>
                                </select> 
                            </td>
                            <td>
                                <input type="image" src="<?php echo Yii::app()->theme->baseUrl; ?>/images/shared/top_search_btn.gif"  />
                            </td>
                        </tr>
                    </table>
                </div>-->
                <!--  end top-search -->
                <div class="clear"></div>

            </div>
            <!-- End: page-top -->

        </div>
        <!-- End: page-top-outer -->

        <div class="clear">&nbsp;</div>

        <!--  start nav-outer-repeat................................................................................................. START -->
        <?php if (Yii::app()->user->id !== null): ?>
        <div class="nav-outer-repeat"> 
            <!--  start nav-outer -->
            <div class="nav-outer"> 
                
                <!-- start nav-right -->
                <div id="nav-right">

                    <div class="nav-divider">&nbsp;</div>
                    <div class="showhide-account"><img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/shared/nav/nav_myaccount.gif" width="93" height="14" alt="" /></div>
                    <div class="nav-divider">&nbsp;</div>
                    <a href="<?php echo Yii::app()->createUrl('site/logout') ?>" id="logout"><img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/shared/nav/nav_logout.gif" width="64" height="14" alt="" /></a>
                    <div class="clear">&nbsp;</div>

                    <!--  start account-content -->	
                    <div class="account-content">
                        <div class="account-drop-inner">
                            <a href="" id="acc-settings">Settings</a>
                            <div class="clear">&nbsp;</div>
                            <div class="acc-line">&nbsp;</div>
                            <a href="" id="acc-details">Personal details </a>
                            <div class="clear">&nbsp;</div>
                            <div class="acc-line">&nbsp;</div>
                            <a href="" id="acc-project">Project details</a>
                            <div class="clear">&nbsp;</div>
                            <div class="acc-line">&nbsp;</div>
                            <a href="" id="acc-inbox">Inbox</a>
                            <div class="clear">&nbsp;</div>
                            <div class="acc-line">&nbsp;</div>
                            <a href="" id="acc-stats">Statistics</a> 
                        </div>
                    </div>
                    <!--  end account-content -->

                </div>               
                <!-- end nav-right -->


                <!--  start nav -->
               
                <div class="nav">
                    <div class="table">
                        
                        <ul class="select <?php echo ($controller == 'drink') ? 'current' : '' ?>"><li><a href="<?php echo Yii::app()->createUrl('menu/drink/admin'); ?>"><b>Menu Management</b><!--[if IE 7]><!--></a><!--<![endif]-->
                        <!--[if lte IE 6]><table><tr><td><![endif]-->
                                <div class="select_sub">
                                    <ul class="sub">
                                        <li><a href="<?php echo Yii::app()->createUrl('menu/drinkType/admin'); ?>">Drink Type Management</a></li>
                                        <li><a href="<?php echo Yii::app()->createUrl('menu/syrup/admin'); ?>">Syrup Management</a></li>
                                        <li><a href="<?php echo Yii::app()->createUrl('menu/recipiedetail/admin'); ?>">Recipie Management</a></li>
                                        <li><a href="<?php echo Yii::app()->createUrl('menu/material/admin'); ?>">Material Management</a></li>
                                        <li><a href="<?php echo Yii::app()->createUrl('menu/unit/admin'); ?>">Unit Management</a></li>
                                        <li><a href="<?php echo Yii::app()->createUrl('menu/supplier/admin'); ?>">Supplier Management</a></li>
                                    </ul>
                                </div>
                                <!--[if lte IE 6]></td></tr></table></a><![endif]-->
                            </li>
                        </ul>

                        <div class="nav-divider">&nbsp;</div>

                        <ul class="select <?php echo ($controller == 'orders') ? 'current' : '' ?>"><li><a href="<?php echo Yii::app()->createUrl('invoice/orders/admin'); ?>"><b>Orders Management</b><!--[if IE 7]><!--></a><!--<![endif]-->
                            <!--[if lte IE 6]><table><tr><td><![endif]-->
                                <div class="select_sub">
                                    <ul class="sub">
                                        <li><a href="<?php echo Yii::app()->createUrl('invoice/orders/statisticsCupsOfCoffee'); ?>">Statistics Management</a></li>
                                    </ul>
                                </div>
                                <!--[if lte IE 6]></td></tr></table></a><![endif]-->
                            </li>
                        </ul>

                        <div class="nav-divider">&nbsp;</div>

                        <ul class="select <?php echo ($controller == 'user') ? 'current' : '' ?>"><li><a href="<?php echo Yii::app()->createUrl('user/user/admin'); ?>"><b>User Management</b><!--[if IE 7]><!--></a><!--<![endif]-->
                            </li>
                        </ul>
                        
                        <div class="nav-divider">&nbsp;</div>

                        <ul class="select <?php echo ($controller == '') ? 'current' : '' ?>"><li><a href="<?php echo Yii::app()->createUrl('menu/materialrequest/admin'); ?>"><b>Request Management</b><!--[if IE 7]><!--></a><!--<![endif]-->                            </li>
                        </ul>

<!--                        <div class="nav-divider">&nbsp;</div>

                        <ul class="select"><li><a href="#nogo"><b>Turnover</b>[if IE 7]><!</a><![endif]                        
                            </li>
                        </ul>-->
                        
                        <div class="nav-divider">&nbsp;</div>

                        <ul class="select"><li><a href="javascript:void(0)" id="upgrade_menu_version" onClick="ajaxUpgradeMenuVersion()"><b>Upgrade Menu</b><!--[if IE 7]><!--></a><!--<![endif]-->                        
                                <img src="<?php echo Yii::app()->theme->baseUrl."/images/loading.gif" ?>" class="loading hide" />
                                <span id="current_menu_version"><?php echo menuService::getCurrentMenyVersion(); ?></span>
                            </li>
                        </ul>
                        
                        <div class="nav-divider">&nbsp;</div>
                        
                        <div class="clear"></div>
                        
                    </div>
                    <div class="clear"></div>
                </div>
                <!--  start nav -->

            </div>
            <div class="clear"></div>
            <!--  start nav-outer -->
        </div>
        <?php endif; ?>
        <!--  start nav-outer-repeat................................................... END -->

        <div class="clear"></div>

        <!-- start content-outer ........................................................................................................................START -->
        <div id="content-outer">
            <!-- start content -->
            <div id="content">

                <?php echo $content; ?>
                
                <div class="clear">&nbsp;</div>

            </div>
            <!--  end content -->
            <div class="clear">&nbsp;</div>
        </div>
        <!--  end content-outer........................................................END -->

        <div class="clear">&nbsp;</div>

        <!-- start footer -->         
        <div id="footer">
            <!--  start footer-left -->
            <div id="footer-left" style="font-size: 0.1em">
                Admin Skin &copy; Copyright Internet Dreams Ltd. <span id="spanYear"></span> <a href="">www.netdreams.co.uk</a>. All rights reserved.</div>
            <!--  end footer-left -->
            <div class="clear">&nbsp;</div>
        </div>
        <!-- end footer -->   
        <script type="text/javascript">
            $().ready(function(){
                //auto check new request in 30 seconds
                setInterval(function(){
                    $.ajax({
                        url: "<?php echo Yii::app()->createUrl('menu/materialrequest/alertIncomingRequest'); ?>",
                        success: function(data){                        
                            if (0 != data){
                                alert('New request');
                            }
                        }
                    });
                }, 30000);
            });
            function ajaxUpgradeMenuVersion(){
                   $.ajax({
                       url: "<?php echo Yii::app()->createUrl("menu/config/upgradeMenuVersion"); ?>",
                       beforeSend: function(){
                           if (confirm("Upgrade Menu To New Version?")){
                               $(".loading").show();
                               return true;
                           }else return false;                        
                       },
                       success: function(data){
                           $(".loading").hide();
                           $("span#current_menu_version").html(data);
                       }

                   });
               }
        </script>
    </body>
</html>